home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 17
/
CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso
/
CUCD
/
Programming
/
DiceSource
/
suplib
/
strins.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-25
|
343b
|
31 lines
#include <stdlib.h>
#include <string.h>
void
strins(d, s)
char *d;
const char *s;
{
int len = strlen(s); /* # bytes to insert */
char *ptr;
/*
* make room
*/
ptr = d + strlen(d);
while (ptr >= d) {
ptr[len] = ptr[0];
--ptr;
}
/*
* insert string
*/
while (*s)
*++ptr = *s++;
}